#coding:utf-8

from functools import reduce

def prod(x, y):
    return x*y

def add(x,y):
    return x+y

print (reduce(prod, [2, 4, 5, 7, 12]))
print (reduce(add, [2, 4, 5, 7, 12]))